A negotiation mode of a device in a network may be configured as an auto-negotiation mode or a non-auto-negotiation mode. Auto-negotiation means that a device notifies, of a working manner in which the device operates, another device that communicates with the device and that is at a remote end of a link, and detects an operation working manner notified by the device at the remote end, that is, the devices at two ends of the link achieve the highest working level by means of information exchange and automatic configuration. Non-auto-negotiation means that a particular working manner is forcibly set for a device, and the device does not negotiate with a peer device.
Only when negotiation modes of devices at two ends of a link are kept consistent, statuses of ports of the devices at the two ends can be normal, that is, the ports can be up and can further normally receive and send a packet. If negotiation modes of the devices at the two ends of the link are inconsistent, a port of a device whose negotiation mode is a non-auto-negotiation mode is up, and a port of a device whose negotiation mode is an auto-negotiation mode is down.
A status of a port relates to a connection of a physical layer (PHY). Some intelligent network devices have respective PHYs in structure, and the PHY is used to receive, send, and parse a packet. When such an intelligent network device connects to a network, a negotiation mode configuration of the intelligent network device also needs to be kept consistent with that of a network device that connects to the network and that is connected to the intelligent network device.
For example, an atom meter (AM) as an intelligent network device replacing an optical module may be inserted into a service port of any device, for example, a base station, a router, or a switch, in an existing network, and is used to implement optical-to-electrical conversion, network performance detection, and the like. The AM has two PHYs in structure. One PHY is connected to a host device of the AM, and the other PHY is connected to a device that communicates with the host device and that is at a remote end of a link. Respective negotiation mode configurations of the two PHYs need to be kept consistent with a negotiation configuration of the network device. Only in this way, it can be ensured that all ports are up in order to normally receive and send a packet.
The AM is an independent network device, and cannot sense a negotiation mode configuration of a network device connected to the AM. Usually, the negotiation mode of the AM is constant, and the AM is deployed on a network device having the same negotiation mode as that of the AM. When the negotiation mode of the network device connected to the AM is changed from a non-auto-negotiation mode to an auto-negotiation mode, a port of the network device connected to the AM is down. For such a case, in other approaches, in some solutions, a special-purpose tool is used to change the negotiation mode of the AM when the AM is offline, and then the AM connects to a network. However, in this way, not only normal communication of the network device is severely affected, but also application flexibility of the intelligent network device AM is affected.